import { defineStore } from 'pinia'
import { store } from '@common'
// store.dict dict_show_list,dict_enable_list,dict_success_list,dict_yes_list
// store.dict getDictByType
export const useDict = defineStore('dict', {
  state: () => ({
    // 菜单类型
    menu_type_list: [
      {
        label: '目录',
        value: 'M'
      },
      {
        label: '菜单',
        value: 'C'
      },
      {
        label: '按钮',
        value: 'F'
      }
    ],
    dict_oper_type: [],
    ...store.dict.state()
  }),
  actions: {
    ...store.dict.actions,
    async getSysOperType() {
      if (this.dict_oper_type.length === 0) {
        await this.getDictByType('sys_oper_type', 'dict_oper_type')
      }
    }
  }
})
